package com.hjx.springbootserver.entity;

import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.PrePersist;

@Entity
public class User {
	@Column(length=32)
	private String id;
	@Column(length=32)
	private String userName;
	private String password;
	
	@PrePersist
	public void initId(){
		id=UUID.randomUUID().toString().replaceAll("-", "");
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
}
